

<%@page import="DTO.Cart"%>
<%@page import="BLL.BFavorite"%>
<%@page import="DTO.Favorite"%>
<%@page import="BLL.BUser"%>
<%@page import="BLL.BProduct"%>
<%@page import="DTO.Product"%>
<!-- saved from url=(0038)http://shopmypham.com.vn/vn/trang-chu/ -->
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">





<link href="css/style.css" type="text/css" rel="stylesheet">


<title>Gio hang</title>
</head> 
<body><div id="WzTtDiV" style="visibility: hidden; position: absolute; overflow-x: hidden; overflow-y: hidden; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; left: 0px; top: 0px; width: 0px; "></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
    <tr>
        <td width="50%">&nbsp;</td>
        <td>
            <table>
                
                <tr>
                    <td width="70%"><img src="images/banner.jpg"></td>
                    <td>
                        <!---cho nay la chen login form vo --->
   <%@include file="login_form.jsp" %>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
<tr style="background-image:url(http://shopmypham.com.vn/theme_images/menu/bgtop.gif); background-repeat:repeat-x; background-position:top">
<td width="50%"><img src="images/bgtop.gif"></td>
<td>

<!--
cho nay viet menubar vo nghe
-->

 <%@include file="menu_bar.jsp" %>


</td>	
<td width="50%"><img src="images/bgtop.gif"></td>
</tr>

<tr>
<td width="50%" valign="top" style="background-image:url(http://shopmypham.com.vn/theme_images/bg.jpg); background-repeat:repeat-x; background-position:top"><img src="images/spacer.gif" width="1" height="1"><img src="images/spacer.gif" width="1" height="1"></td>
<td valign="top" style="background-image:url(http://shopmypham.com.vn/theme_images/bg.jpg); background-repeat:repeat-x; background-position:top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody><tr>
<td style="padding-bottom:30px"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody><tr>
<td align="center" style="padding:5px"><a href="http://shopmypham.com.vn/san_pham_hang_115"><img src="images/1009VELVI96_tinhyeu.gif" border="0" title="Tình yêu"></a></td>
<td align="center" style="padding:5px"><a href="http://shopmypham.com.vn/san_pham_hang_116"><img src="images/459VELVPTC_sinhnhat.gif" border="0" title="Sinh nh?t"></a></td>
<td align="center" style="padding:5px"><a href="http://shopmypham.com.vn/san_pham_hang_117"><img src="images/539VELVUGD_teen.gif" border="0" title="Teen"></a></td>
<td align="center" style="padding:5px"><a href="http://shopmypham.com.vn/san_pham_hang_118"><img src="images/219VEM00I5_bantrai.gif" border="0" title="B?n trai"></a></td>
<td align="center" style="padding:5px"><a href="http://shopmypham.com.vn/san_pham_hang_119"><img src="images/369VEM02FS_bangai.gif" border="0" title="B?n gái"></a></td>
<td align="center" style="padding:5px"><a href="http://shopmypham.com.vn/san_pham_hang_120"><img src="images/739VEM04P6_chobeyeu.gif" border="0" title="Cho bé yêu"></a></td>
<td align="center" style="padding:5px"><a href="http://shopmypham.com.vn/san_pham_hang_125"><img src="images/49VEM06BH_thucongmynghe.gif" border="0" title="Th? công m? ngh?"></a></td>
</tr>
</tbody></table></td>
</tr>
</tbody></table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody><tr>
<td class="leftBlock">

<!-- 
	cho nay viet left bar vo
-->
<%@include file="left_bar.jsp" %>



</td>
<td width="100%" valign="top" style="padding-left:10px; padding-right:10px; padding-bottom:10px"><!-- FOOTER --><table width="100%" border="0" cellspacing="0" cellpadding="0">
</table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td valign="top" style="padding-bottom:10px"><script type="text/javascript" src="images/tooltip.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody><tr>
<td style=""><img src="images/xemnhieunhat.gif"></td>
</tr>
</tbody></table>
                 <%
                            String pId =  request.getParameter("pId");
                            BProduct bp = new BProduct();
                            BUser bu = new BUser();
                           
                             String userString = (String)session.getAttribute("username");
                             DTO.User user = new BUser().getByUsername(userString);
                            
                             
                             
                            
                             
                             ArrayList<Cart> cs = user.getCarts();
                             if(cs == null)
                                                                 {
                                 %>
                                 <h3>Ban chua co san pham nao trong gio hang</h3>
                                 <%
                             }
                             else
                                                                 {
                             
                            %>
             
  <table style="margin-left: 120px; margin-top: 40px; border: #F59740; border-style: solid; border-width: 2px;" width="100%">
 	<tr>
 		<td width="100%">
                   <table width="100%" height="30">
            <tr>
                <td>
                    <p><b>Hướng dẫn:</b> Để xóa sản phẩm khỏi giỏ hàng, click Xóa bỏ / Điền số lượng sản phẩm vào ô rồi click Cập nhật để thêm số lượng</p>
                </td>
            </tr>
        </table>
        
        <table width="100%">
            <tr>
                <td>
                    <table width="100%" border="1">
                    
                   
                    
                    <tbody><tr>
                    <td class="title td">Số lượng</td>
                    <td class="title td">Tên sản phẩm</td>
                    <td class="title td">Giá</td>
                    <td class="title td">&nbsp;</td>
                    </tr>
                    <%
                    if(cs != null)
                                               {
                        for(Cart cart : cs)
                                                       {
                            %>
                    
                    
                    <tr>
                    <td align="center">
                    <form name="frmcart" action="servlet" method="post">
                    <input name="add_my_cart_update" type="hidden">
                    <input name="buy_number" size="15" style="text-align: center;" type="text">
                    <div style="padding-top:5px"><input value="Cập nhật" type="submit"></div>
                    </td></form>
                    <td class="td">
                    
                    <div class="title"><a href="#" class="title">
                            
                           <%=cart.getProduct().getName()%>
                        
                        </a></div></td>
                    <td class="td">
                        <%=
                       cart.getProduct().getPrice()
                        %>        
                    </td>
                    <form name="frmcart" action="CartServlet" method="post">
                        <input name="cartId" type="hidden" value="<%=cart.getCartId()%>">
                    <td class="td"><input value="Xóa bỏ" type="submit"></td>
                    </form>
                    </tr>
                    
                    <%
                                       }
                        
                        }
                    %>
                    <tr>
                    <td></td>
                    <td style="padding-right: 10px;" class="td" align="right"><strong>Tổng cộng: </strong></td>
                    <td style="padding-left: 10px;">
                        <%
                        
                        String tong = (String) request.getAttribute("tong");
                        if(tong==null) tong="3";
                        int s = Integer.parseInt(tong);
                        String pr=null;
                        //pr=priceProduct.getPrice();
                        if(pr==null) pr="4";
                        int price = Integer.parseInt(pr);
                        s=s*price;
                        out.print(s+" VND");
                        %>
                        
                    </td>
                    <form name="frmcart" action="servlet" method="post">
                    <input name="add_my_cart_continus" type="hidden">
                    <td class="td"><input value="Tiếp tục mua" type="submit"></td></form>
                    </tr>
                    <%
                                               }
                  
%>


                    
                    
                    </tbody></table>
<table class="content" cellpadding="5" cellspacing="2" width="100%">
            <tbody><tr>
            <td colspan="2" class="title" bgcolor="#CCCCCC">Thông tin thanh toán</td>
            </tr>
            <tr>
            <td></td>
            <td style="color: rgb(255, 0, 0);">" Du lieu nguoi dung"</td>
            </tr>
            <tr>
            <td class="title" colspan="2" style="padding-left: 20px;" nowrap="nowrap" align="left">THÔNG TIN NGƯỜI ĐẶT HÀNG  :</td>
            </tr>
            <tr>
            <td nowrap="nowrap" align="right">Họ và Tên  :</td>
            <td>
                <%=user.getUsername()%>
            </td>
            </tr>
            <tr>
            <td nowrap="nowrap" align="right">Địa chỉ  :</td>
            <td class="form_asterisk" nowrap="nowrap">
                <%=user.getAddress()%>
            </td>
            </tr>
            <tr>
            <td nowrap="nowrap" align="right">E-mail :</td>
            <td class="form_asterisk">
                <%=user.getEmail()%>
            </td>
            </tr>
            <tr>
            <td nowrap="nowrap" align="right">Điện thoại  :</td>
            <td class="form_asterisk">
                <%=user.getNumberPhone()%>
            </td>
            </tr>
          
            <tr>
                <td>&nbsp;</td>
                <td>
                    <input type="submit" value="Đặt hàng"/> 
                </td>
            </tr>

            </tbody>
        </table>
                    
                </td>
            </tr>
        </table>
                </td>
 	</tr>
 	           
 </table>




</td></tr></tbody></table></td>
</tr>
</tbody></table>	</td>
<td width="50%" valign="top" style="background-image:url(http://shopmypham.com.vn/theme_images/bg.jpg); background-repeat:repeat-x; background-position:top"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>  
<tr height="80">
<td valign="bottom" style="padding:10px; background-color:#232323; color:#232323" colspan="3" align="center">
<font style="color:#FFFFFF">Bkq Group<br>
Hotline: 123456   - Email: bkqvn@gmail.com<br><br>
B?n quy?n website thu?c v? http://bkqvn.com<br><br>
</font><br>

</td>
</tr>
</tbody></table>
</body></html>